import request from "@/utils/request";
// 用户管理分页列表的请求

// 获取角色分页列表
export const reqUserList = (page, limit, searchParams) => {
  return request.get(`/admin/acl/user/${page}/${limit}`, {
    params: searchParams
  });
};
// 修改用户
export const reqUpdataUser = userInfo => {
  return request.put(`/admin/acl/user/update`, userInfo);
};

// 删除一个用户信息
export const reqDeleteUser = id => {
  return request.delete(`/admin/acl/user/remove/${id}`);
};
// 新增一个用户信息
export const reqAddUserItem = userInfo => {
  return request.post(`/admin/acl/user/save`, userInfo);
};

//批量删除请求
export const reqDeleteAllChecked = idList => {
  return request.delete(`/admin/acl/user/batchRemove`, { data: idList });
};

// 请求角色的列表
export const reqUserCosList = userId => {
  return request.get(`/admin/acl/user/toAssign/${userId}`);
};

//分配用户角色
export const reqCosFenpeiList = (userId, roleId) => {
  return request.post(`/admin/acl/user/doAssign`, {
    params: {
      userId,
      roleId
    }
  });
};
